package com.longteng.lesson.po;

import lombok.Data;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * Created by Administrator
 * DATE : 2018/5/20
 * TIME : 9:50
 * PROJECT : java-lesson
 * PACKAGE : com.longteng.lesson
 *
 * @author <a href="mailto:taki@qq.com">Administrator</a>
 */
@Data
public class MyUser {
    @NotNull
    @NotEmpty(message = "用户名不能为空!")
    private String name;
    @NotNull
    @NotEmpty(message = "密码不能为空!")
    @Size(min = 8,max = 12,message = "密码长度必须在8-12位之间")
    private String password;
    @NotNull
    @Past(message = "生日必须早于当前日期!")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

}
